package com.gateway.filter;

import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @作者: 林江
 * @创建时间: 2023/10/30
 * @功能: 用户自定义网关过滤器
 */
//@Component
public class CustomGatewayGlobalFilter implements GlobalFilter, Ordered {
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        System.out.println("用户自定义网关过滤器。。。。。");
        return chain.filter(exchange);
    }

    @Override
    public int getOrder() {
        return -1;
    }
}
